package ar.com.juanlopezcervero.flexigrid4j.params;

import java.io.Serializable;

import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

public class FlexigridSearchItems extends FlexigridItem implements Serializable {

	private static final long serialVersionUID = -4640437548931307685L;

	//	{display: 'Nombre', name : 'name', isdefault: true},
	
	private String display;
	private String name;
	private Boolean isDefault = null;
	
	public FlexigridSearchItems() {
		super();
	}
	
	public FlexigridSearchItems(String display, String name) {
		this.display = display;
		this.name = name;
	}
	
	public FlexigridSearchItems(String display, String name, Boolean isDefault) {
		this(display, name);
		this.isDefault = isDefault;
	}
	
	@Override
	public JSONObject getJSONObejct() throws JSONException {
		JSONObject jsonObject = new JSONObject();
		jsonObject.putOpt("display", display);
		jsonObject.putOpt("name", name);
		jsonObject.putOpt("isDefault", isDefault);
		return jsonObject;
	}
	
	public String getDisplay() {
		return display;
	}
	/**
	 * Display name
	 * @param display
	 */
	public void setDisplay(String display) {
		this.display = display;
	}
	public String getName() {
		return name;
	}
	/**
	 * Attribute name
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}
	public Boolean getIsDefault() {
		return isDefault;
	}
	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}
	
}
